package com.cmy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

@Controller
public class ControllerRestFul {
    @RequestMapping("/add")
    public String normal(int a, int b, Model model){
        int res = a+b;
        model.addAttribute("msg",res);
        return "style";
    }
    @RequestMapping("/add/{a}/{b}")
    public String restful(@PathVariable int a,@PathVariable int b, Model model){
        int res = a+b;
        model.addAttribute("msg",res);
        return "style";
    }
    @RequestMapping(value = "/add/{a}/{b}",method = RequestMethod.POST)
    public String restful01(@PathVariable int a,@PathVariable int b, Model model){
        int res = a+b;
        model.addAttribute("msg",res);
        return "style";
    }

}

    